package com.mxx.qh.network;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.HTTP;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

public interface ApiService {

    /**
     * get 无参数
     *
     * @param url 地址
     * @return Response<ResponseBody>
     */
    @GET
    Observable<Response<ResponseBody>> executeMethodGet(@Url String url);

    /**
     * post json提交
     *
     * @param url    地址
     * @param params 参数
     * @return Response<ResponseBody>
     */
    @POST
    Observable<Response<ResponseBody>> executePostJsonMethod(@Url String url, @Body RequestBody params);

    /**
     * post表单提交
     *
     * @param url    地址
     * @param params 参数
     * @return Response<ResponseBody>
     */
    @POST
    @FormUrlEncoded
    Observable<Response<ResponseBody>> executePostFormMethod(@Url String url, @FieldMap Map<String, String> params);

    @GET
    @Streaming
    Observable<Response<ResponseBody>> executeDownload(@Url String url);
}
